import sys
from PySide6.QtWidgets import QApplication
from main_window import MainWindow
from qt_material import apply_stylesheet

# def load_station_data():
#     # 从stations.txt加载车站数据
#     stations = []
#     try:
#         with open("stations.txt", "r", encoding="utf-8") as f:
#             for line in f:
#                 line = line.strip()
#                 if line:
#                     station_name = line.split(",")[0]
#                     stations.append(station_name)
#     except FileNotFoundError:
#         print("错误：未找到stations.txt文件")
#     return stations

if __name__ == "__main__":
    app = QApplication(sys.argv)
    window = MainWindow()
    window.setWindowTitle("12306智能抢票系统")
    window.resize(1200, 800)
    apply_stylesheet(app, theme='dark_teal.xml')  # 使用qt-material皮肤
    
    # 加载车站数据
    #stations = load_station_data()
    # 传递给后台线程
   # window.worker.stations = stations
    
    window.show()
    sys.exit(app.exec())